package com.lmf.cloud.controller.feign;

import com.lmf.cloud.controller.fallback.SeataStorageFeignFallback;
import com.lmf.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description TODO
 * <p>
 * Copyright @2022 Shanghai Mise Co. Ltd.
 * All right reserved.
 * <p>
 * @Author LiuMingFu
 * @Date 2024/8/1 19:33
 */
@FeignClient(value = "cloud-nacos-seata-storage-9009", path = "/t-storage", fallback = SeataStorageFeignFallback.class)
public interface SeataStorageFeign {

    /**
     * 扣减库存
     *
     * @param productId 产品id
     * @param count     数量
     * @return
     */
    @RequestMapping("/decreaseStorage")
    ResultData<Boolean> decreaseStorage(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);
}
